/*
 * @Description: 描述信息
 * @Version: 版本号
 * @Author: xuebao
 * @Date: 2023-12-11 09:12:45
 * @LastEditors: xuebao
 * @LastEditTime: 2023-12-11 09:26:59
 */
/**
 * 环境配置封装
 *
 */


type ENV = 'test' | "prod" | 'dev'//测试 生产 开发


// let env: ENV = "dev"
// if (location.host.indexOf('localhost') > -1) {
//   env = "dev"
// } else if (location.host === 'driver-stg.marsview.cc') {
//   env = 'test'
// } else {
//   env = 'prod'
// }

const env = document.documentElement.dataset.env as ENV || 'dev';//运行时环境
// document.documentElement.dataset.env 前提是在index.html头部说明 <html lang="en" data-env="test">
const config = {
  //开发
  dev: {
    baseApi: '/api',
    uploadApi: 'http://api-driver.marsview.cc',
    mock: true,
    mockApi: 'https://www.fastmock.site/mock/9bea9cbf35cda2a13cdbcf3454a6f998/api',
    cdn: 'http://xxx.aliyun.com'
  },
  //测试
  test: {
    baseApi: '/api',
    uploadApi: 'http://api-driver-stg.marsview.cc',
    mock: false,
    mockApi: 'https://www.fastmock.site/mock/9bea9cbf35cda2a13cdbcf3454a6f998/api',
    cdn: 'http://xxx.aliyun.com'
  },
  //生产
  prod: {
    baseApi: '/api',
    uploadApi: 'http://api-driver.marsview.cc',
    mock: false,
    mockApi: 'https://www.fastmock.site/mock/9bea9cbf35cda2a13cdbcf3454a6f998/api',
    cdn: 'http://xxx.aliyun.com'
  }
}
export default {
  ...config[env]
}
